﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace TriangleGame
{
    public class Tupla : IComparable
    {
        private Punto A;
        private Punto B;
        private double alfa;
        private bool IsLinked;
        private double distance;

        public Tupla(Punto A, Punto B, double alfa, double dist)
        {
            this.A = A;
            this.B = B;
            this.alfa = alfa;
            this.IsLinked = false;
            this.distance = dist;
        }

        public Punto getPuntoA() { return A; }
        public Punto getPuntoB() { return B; }
        public double getAlfa() { return alfa; }
        public bool getLinked() { return IsLinked; }
        public double getDistance() { return distance; }

        public void setLinked(bool b) { IsLinked = b; }

        public int CompareTo(object obj)
        {
            if ((obj != null) && (this.GetType() == obj.GetType()))
            {
                return CompareTo((Tupla)obj);
            }
            else
                throw new Exception("valore passato nullo");
        }

        public int CompareTo(Tupla t)
        {
            if (t == null)
                throw new Exception("valore passato nullo");

            if (distance == t.getDistance())
                return 0;
            else if (distance < t.getDistance())
                return -1;
            else
                return 1;
        }


    }//class Tupla
}
